class City < ActiveRecord::Base; end

class Add500Cities < ActiveRecord::Migration
  def self.up
     say_with_time "Importing ~500 world cities..." do
        IO.foreach('db/cities.csv') do |line|
           row = line.split(/\t/)
           City.create :name => "#{row[0]}, #{row[1]}", :latitude => row[2].to_f, :longitude => row[3].to_f
        end
     end
  end

  def self.down
     City.delete_all
  end
end
